export interface CameraConfigAction {
  type: string;
  payload: Record<string, unknown>;
}

export const loadCameraConfigCreator = (cameraConfig: Record<string, unknown>) => {
	const parseZoom = parseFloat(cameraConfig.zoom);
	if (!isNaN(parseZoom)) {
		if (parseZoom < 0) {
			cameraConfig.zoom = 0
		} else if (parseZoom > 1) {
			cameraConfig.zoom = 1
		} else {
			cameraConfig.zoom = parseZoom
		}
	} else {
		delete cameraConfig.zoom
	}
	console.log(cameraConfig);
	return {
           type: 'LOAD',
           payload: cameraConfig,
         }
};
